﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using BaiTu.ILogging;
using Autofac.Core;

namespace BaiTu.Logging.Dependency
{
    /// <summary>
    /// 依赖注入项
    /// </summary>
    public class LoggingDependency : BaiTu.IOCServices.IDependencyRegistrater
    {
        public void Register(ContainerBuilder builder, BaiTu.Framework.Core.TypeFinder.ITypeFinder typeFinder)
        {
            //  builder.RegisterType<FacebookProviderAuthorizer>().As<IOAuthProviderFacebookAuthorizer>().InstancePerLifetimeScope();
            builder.RegisterModule(new LoggingModule());
            // by default, use Coevery's logger that delegates to Castle's logger factory
            builder.RegisterType<Logging.BaiTuLog4netLogger>().InstancePerLifetimeScope();
            builder.RegisterType<BaiTuLog4netLogger>().InstancePerLifetimeScope();
        }

        public int Order
        {
            get { return 100; }
        }

    }
}
